/**
 * @description 主题仓库
 */

import { defineStore } from 'pinia'
import { darkTheme, lightTheme } from "naive-ui"

export default defineStore('themeStore', {
    state: () => ({ theme: lightTheme, isDark: false }),
    getters: {},
    actions: {
        toggleTheme() {
            this.isDark = !this.isDark
            this.theme = [lightTheme, darkTheme][Number(this.isDark)]
        }
    }
})